import java.util.*;

public class Vertex {
	protected String name;
	protected ArrayList edges;
	
	Vertex(String name){
		this.name = name;
		edges = new ArrayList();
	}
	
	public String toString(){
		String result = name;
		for(int i=0; i<edges.size(); i++){
			result += "\n "+edges.get(i);
		}
		return result;
	}
	
	public String getName(){
		return name;
	}
	
	public void addEdge(Edge e){
		edges.add(e);
	}
	public Iterator outEdges(){
		return edges.iterator();
	}
	public int edgeCount(){
		return edges.size();
	}
}
